From: Florian Müllner Date: Wed, 7 Sep 2022 14:57:08 +0000 (+0200) Subject: unlockDialog: Only show switch-user button for multiple users X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~75 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=756f212d6608ca281598b37033f114d1d5b0afe5;p=gnome-shell.git unlockDialog: Only show switch-user button for multiple users We don't offer "Switch user" on single-user systems when unlocked, so it is a bit weird to include it while locked. Part-of: --- diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 62b6cc3dc..0e56f6e7d 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -585,8 +585,10 @@ export const UnlockDialog = GObject.registerClass({ this._lockdownSettings.connect('changed::disable-user-switching', this._updateUserSwitchVisibility.bind(this)); - this._user.connectObject('notify::is-loaded', - this._updateUserSwitchVisibility.bind(this), this); + this._user.connectObject( + 'notify::is-loaded', () => this._updateUserSwitchVisibility(), + 'notify::has-multiple-users', () => this._updateUserSwitchVisibility(), + this); this._updateUserSwitchVisibility(); @@ -850,6 +852,7 @@ export const UnlockDialog = GObject.registerClass({ _updateUserSwitchVisibility() { this._otherUserButton.visible = this._userManager.can_switch() && + this._userManager.has_multiple_users && this._screenSaverSettings.get_boolean('user-switch-enabled') && !this._lockdownSettings.get_boolean('disable-user-switching'); }